Skip to content

fix(windows): Keep the overlay out of the fullscreen window list - #1267

Merged
omesser merged 4 commits into
mainfrom
cursor/windows-overlay-fullscreen-hide-828b
Oct 2, 2026
Merged

omesser merged 4 commits into
mainfrom
cursor/windows-overlay-fullscreen-hide-828b

Conversation

@omesser

@omesser omesser commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Why

On Windows the character fades about a second after it appears (presence: hidden over 500ms) and Come back cannot restore it. The fullscreen rule stays true because the display-sized overlay is in the window list. After this change that overlay is not counted, so the same desktop reports no fullscreen window and Come back fades the character back in.

The logged displays are 3440×1440 at the origin and 1200×1920 at (-1200, -209). With those rectangles in the window list, HideRules::update returns a 500ms fade, and a later Come back returns no change while presence stays hidden. With the overlay hwnds removed, fullscreen_frontmost is false and that Come back returns the fade-in.

What changed

Click-through on Windows goes through set_overlay_click_through. The frame loop is not the event-loop thread, and tao posts the style rewrite and returns before it runs. The tool-window bits (WS_EX_TOOLWINDOW, WS_EX_NOACTIVATE, WS_EX_TOPMOST, WS_EX_LAYERED) are put back on the event-loop thread after that rewrite. WS_EX_TRANSPARENT stays as the caller left it. The window-list poll also drops hwnds registered as overlays, so a rewrite that lands before those bits are restored still cannot hide the character. The registry lives with the overlay module. The poll thread only reads it.

Chat and Settings stay in the window list, so they remain perches.

How to verify

cargo test -p fidget a_click_through_rewrite_keeps -- --nocapture
cargo test -p fidget-core display_sized_overlays_hide -- --nocapture

The first test failed on the stub (the overlay hwnd was still counted, and the tool-window bit was not restored) and passes after the fix. The core test shows the 500ms fade and that Come back waits until the fullscreen flag is clear.

This VM is Linux, so the Win32 style write was not executed on a desktop. Windows CI compiles that path. cargo check --target x86_64-pc-windows-msvc stopped in ring's C build (assert.h missing) before fidget's windows module.

cargo test --workspace --all-targets on Linux reported 697 passed and 4 failed. The failures are GTK initialized from two threads (double_click_interval_ms_matches_gtk_settings) and Secret Service with no daemon (linux_secret_service). Those tests do not touch this diff.

Notes

#1266 is milestone V1 with labels bug, windows, and p0. Moving it on project 2 failed because this token cannot read that project. Assigning it was refused (Resource not accessible by integration).

Closes #1266

— Cursor agent (Coder), on @omesser's behalf.

Open in Web Open in Cursor 

cursoragent and others added 2 commits October 2, 2026 17:37
Display-sized overlays cover both screens, so Come back cannot restore a character the fullscreen rule still holds.

Co-authored-by: Oded Messer <odedmesser@gmail.com>
A click-through rewrite drops the tool-window bit. The overlay then covers its display, the fullscreen rule fades the character, and Come back cannot bring it back.

Co-authored-by: Oded Messer <odedmesser@gmail.com>

@omesser omesser left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soft CLEARED

Tip: 297ef03c52edb2c8af7a433746831e5f2080b5de (cursor/windows-overlay-fullscreen-hide-828b)
PR: #1267 — fix(windows): Keep the overlay out of the fullscreen window list
Mergeable: true (clean)
Closes: #1266 (Windows: character fades on launch; Come back cannot restore)

Soft ledger

Axis Status
(a) CI green on tip Met — build / renderer / windows / checks (ubuntu-latest) / checks (macos-latest) success; Pages deploy skipped
(b) Scope/intent Met — Windows overlay self-counted as fullscreen after click-through drops WS_EX_TOOLWINDOW; dual path: set_overlay_click_through → reinforce_overlay restores tool-window/noactivate/topmost/layered; poll drops registered overlay hwnds; Chat/Settings stay listed
(c) Correctness vs claim Met — matches #1266 / PR body (display-sized overlays → fade; Come back blocked while fullscreen true; overlays removed → fade-in). restore_overlay_exstyle leaves WS_EX_TRANSPARENT as caller set it
(d) Tests Met — a_click_through_rewrite_keeps_the_overlay_out_of_the_window_list; display_sized_overlays_hide_the_character_until_they_leave_the_list; Windows CI compiles the Win32 path
(e) Hygiene Met — MERGEABLE/CLEAN; undrafted; Closes #1266 fits the bug

Soft-FIX

None.

Soft notes (not Soft-FIX)

  • Live Windows desktop not run on this tip (Linux VM); Windows CI compiles; unit tests cover the list/style logic.
  • OVERLAY_HWNDS registers on configure/reinforce and never drops a destroyed overlay. Soft note only: HWND reuse could falsely exclude a later window; dual style restore still covers the rewrite race.

Soft CLEARED Soft (a) Met. Comment-only. Never merge without Oded yes.

— Cursor agent (Architect), on @omesser's behalf.

tao posts the click-through rewrite from the frame loop and returns first. The tool-window bits have to be put back after that write, on the same thread.

Co-authored-by: Oded Messer <odedmesser@gmail.com>

@omesser omesser left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soft CLEARED

Tip: fb05aea5464c9bba4c1284eec3f0ef0e7e3e20ad (cursor/windows-overlay-fullscreen-hide-828b)
Prior Soft CLEARED tip: 297ef03c52edb2c8af7a433746831e5f2080b5de
PR: #1267 — fix(windows): Keep the overlay out of the fullscreen window list
Mergeable: true (MERGEABLE, UNSTABLE while Soft (a) settles)
Closes: #1266 (Windows: character fades on launch; Come back cannot restore)

Tip delta since prior Soft CLEARED

fix(windows): Restore overlay styles on the event-loop thread — frame-loop click-through no longer reinforces on the caller after tao posts the style rewrite. Windows set_click_through runs set_ignore_cursor_events then reinforce_overlay on the event-loop thread (run_on_main_thread when off it; direct when already on it). Unix path unchanged. Dual defense (hwnd registry drop + tool-window restore) retained.

Soft ledger

Axis Status
(a) CI green on tip Settling — build / renderer success; Pages deploy skipped; checks (ubuntu-latest) / checks (macos-latest) / windows still in progress on this tip
(b) Scope/intent Met — still closes #1266; tip tightens the race the prior Soft CLEARED path could lose (tao rewrite lands after sync reinforce)
(c) Correctness vs claim Met — rewrite-then-reinforce ordering on the event-loop thread matches PR body; restore_overlay_exstyle still leaves WS_EX_TRANSPARENT as the caller set it; Chat/Settings stay listed
(d) Tests Met — a_click_through_rewrite_keeps_the_overlay_out_of_the_window_list; display_sized_overlays_hide_the_character_until_they_leave_the_list; Windows CI compiles the Win32 path (thread hop itself is not unit-tested off Windows)
(e) Hygiene Met — MERGEABLE; undrafted; Closes #1266 fits the bug

Soft-FIX

None.

Soft notes (not Soft-FIX)

  • Soft (a) settling on this tip; parent should confirm when green.
  • Live Windows desktop still not run on this tip (Linux VM); unit tests cover list/style logic; Windows CI compiles.
  • OVERLAY_HWNDS still registers and never drops a destroyed overlay (prior Soft note).
  • event_loop_thread latches the first set_click_through caller via OnceLock; setup's build_overlay path is expected to win before the frame loop. Soft note only.

Soft CLEARED Soft (a) settling. Comment-only. Never merge without Oded yes.

— Cursor agent (Architect), on @omesser's behalf.

@omesser omesser left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soft CLEARED Soft (a) settling

Tip: fb05aea5464c9bba4c1284eec3f0ef0e7e3e20ad (cursor/windows-overlay-fullscreen-hide-828b)
Prior Soft CLEARED tip: 297ef03c… (stale — tip moved)
PR: #1267 — fix(windows): Keep the overlay out of the fullscreen window list
Mergeable: true (unstable — Soft (a) settling)
Closes: #1266

Tip delta (297ef03c → fb05aea)

fix(windows): Restore overlay styles on the event-loop thread — frame-loop click-through was reinforcing before tao's posted rewrite landed. Now set_click_through runs rewrite+restore on the event-loop thread (run_on_main_thread when off it). EVENT_LOOP OnceLock seeded by setup set_overlay_click_through in build_overlay (Windows) before the frame loop.

Soft ledger

Axis Status
(a) CI green on tip settling — build / renderer success; windows / checks (ubuntu-latest) / checks (macos-latest) in progress; Pages deploy skipped
(b) Scope/intent Met — same #1266 fix; event-loop ordering closes the rewrite race the prior tip still had
(c) Correctness vs claim Met — dual path kept (event-loop restore + overlay hwnd filter); Chat/Settings still not registered
(d) Tests Met — prior tip tests retained; Soft (a) Windows CI will compile Win32 path
(e) Hygiene Met — undrafted; Closes #1266; MERGEABLE

Soft-FIX

None.

Soft notes (not Soft-FIX)

  • Live Windows desktop not run on this tip.
  • OVERLAY_HWNDS still never drops destroyed overlays (HWND reuse Soft note from prior Soft).
  • Off-event-loop path posts via run_on_main_thread and only eprintlns apply failures; callers see Ok after queue.

Soft CLEARED Soft (a) settling. Comment-only. Never merge without Oded yes.

— Cursor agent (Architect), on @omesser's behalf.

@omesser omesser left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soft Open Soft-FIX

Tip: fb05aea5464c9bba4c1284eec3f0ef0e7e3e20ad (cursor/windows-overlay-fullscreen-hide-828b)
Prior Soft: Soft CLEARED Soft (a) settling on this tip (COMMENTs 5395013805 / 5395016006)
PR: #1267 — fix(windows): Keep the overlay out of the fullscreen window list
Mergeable: true (unstable)
Closes: #1266

Soft ledger

Axis Status
(a) CI green on tip Open — windows failure (PR Tests 37043752689 job 110959949493); build / renderer success; checks (ubuntu-latest) / checks (macos-latest) still in progress; Pages deploy skipped
(b) Scope/intent Met — still the #1266 overlay/fullscreen fix; tip’s event-loop ordering intent holds
(c) Correctness vs claim Open — tip does not compile on Windows; Soft (c) blocked until Soft (a) builds
(d) Tests Met (prior tip unit coverage retained; Soft (a) never reached running them on Windows)
(e) Hygiene Met — undrafted; Closes #1266; MERGEABLE

Soft-FIX (once per tip → Coder)

src-tauri/src/platform/windows/overlay.rs set_click_through (~43–50): E0505 — let window = window.clone(); then window.run_on_main_thread(move \|\| apply_click_through(&window, …)) borrows window for the method call while moving it into the closure.

Fix: keep a clone for the closure and call run_on_main_thread on a separate clone (rustc help: window.clone().run_on_main_thread(move \|\| { … &window … })), e.g.

let window = window.clone();
window
    .clone()
    .run_on_main_thread(move || {
        if let Err(why) = apply_click_through(&window, ignore) {
            eprintln!("overlay: click-through restore failed: {why}");
        }
    })
    .map_err(|e| e.to_string())

Re-run Soft (a) Windows cargo clippy --workspace --all-targets -- -D warnings (CI job) after the tip move.

Soft notes (not Soft-FIX)

  • Soft (a) flipped settling → red after Soft CLEARED Soft (a) settling COMMENTs; this is the Soft-FIX for tip fb05aea.
  • Live Windows desktop still not run on this tip.

Hard Holds. Soft Open Soft-FIX. Comment-only. Never merge without Oded yes.

— Cursor agent (Architect), on @omesser's behalf.

run_on_main_thread borrows the receiver while the closure moves it.

Co-authored-by: Oded Messer <odedmesser@gmail.com>

@omesser omesser left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soft CLEARED Soft (a) settling

Tip: 910d2b04bc4532311883b598e76977e74c6c5225 (cursor/windows-overlay-fullscreen-hide-828b)
Prior Soft Open Soft-FIX tip: fb05aea… (E0505)
PR: #1267 — fix(windows): Keep the overlay out of the fullscreen window list
Mergeable: true (unstable — Soft (a) settling)
Closes: #1266

Soft-FIX Met

window.clone().run_on_main_thread(move || apply_click_through(&window, …)) — dual-clone clears E0505. Tip delta is one line in overlay.rs.

Soft ledger

Axis Status
(a) CI green on tip settling — build success; windows / renderer / checks (ubuntu-latest) / checks (macos-latest) in progress; Pages deploy skipped
(b) Scope/intent Met — Soft-FIX only
(c) Correctness vs claim Met — Soft Open Soft-FIX E0505 closed; event-loop hop + hwnd filter unchanged
(d) Tests Met — prior tip tests retained; Soft (a) Windows clippy will confirm
(e) Hygiene Met — undrafted; Closes #1266; MERGEABLE

Soft-FIX

None further.

Soft notes (not Soft-FIX)

  • Soft notes from prior Soft (live Windows desktop; OVERLAY_HWNDS never drops; off-thread apply failures only eprintln) still apply.

Soft CLEARED Soft (a) settling. Comment-only. Never merge without Oded yes.

— Cursor agent (Architect), on @omesser's behalf.

@omesser
omesser merged commit a18e927 into main Oct 2, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: the character fades on launch and Come back cannot restore it

2 participants